#include <cstdio>

long long cp[ 1001 ], c[ 1001 ][ 1001 ], f[ 1001 ][ 1001 ];

void init( )
{
        int i, j;
        cp[ 0 ] = 1; cp[ 1 ] = 0;
        for ( i = 2; i <= 1000; i++ )
                cp[ i ] = ( i - 1 ) * ( cp[ i - 1 ] + cp[ i - 2 ] ) % 20090818;
        for ( i = 0; i <= 1000; i++ )
        {
                c[ i ][ 0 ] = 1;
                for ( j = 1; j <= i; j++ )
                        c[ i ][ j ] = ( c[ i - 1 ][ j ] + c[ i - 1 ][ j - 1 ] ) % 20090818;
        }
}

int main( )
{
        long long ans;
        int i, n, m;
        init( );
        while ( scanf("%d%d", &n, &m) != EOF )
        {
                ans = 0;
                for ( i = 0; i <= m; i++ )
                        ans = ( ans + c[ n ][ i ] * cp[ n - i ] ) % 20090818;
                printf("%I64d\n", ans);
        }
        return 0;
}
